package com.his.registration.controller;

import com.his.common.Result;
import com.his.registration.pojo.DrugInfo;
import com.his.registration.service.DrugInfoService;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @BelongsProject: workspace-idea
 * @BelongsPackage: com.his.registration.controller
 * @Author: ZhangYing
 * @Date: 2023/7/7 9:00
 * @Description:
 */
@RestController
@CrossOrigin
@RequestMapping("/druginfo")
public class DrugInfoController {
    @Autowired
    private DrugInfoService drugInfoService;

    //根据药品名和助记码搜索药品信息
    @RequestMapping("/selectByCondition")
    public Result selectByCondition(String drugName, String mnemonicCode){
        List<DrugInfo> drugInfoList = drugInfoService.selectByCondition(drugName, mnemonicCode);
        return Result.success(drugInfoList);
    }
}
